From: Tim Janik Date: Fri, 20 Jun 2008 11:09:56 +0000 (+0000) Subject: Fix gtk_widget_get_allocation X-Git-Tag: archive/raspbian/4.4.1+ds1-2+rpi1~1^2~428^2^2~31842 X-Git-Url: https://dgit.raspbian.org/%22http://www.example.com/cgi/%22/%22http:/www.example.com/cgi/%22?a=commitdiff_plain;h=886ffbe067c0009a77d5f7b350b972dcdeb69ad6;p=gtk4.git Fix gtk_widget_get_allocation svn path=/trunk/; revision=20622 --- diff --git a/gtk/gtkwidget.c b/gtk/gtkwidget.c index 30560ba8f1..790d244b9b 100644 --- a/gtk/gtkwidget.c +++ b/gtk/gtkwidget.c @@ -9890,19 +9890,23 @@ gtk_widget_get_has_tooltip (GtkWidget *widget) /** * gtk_widget_get_allocation: * @widget: a #GtkWidget + * @allocation: a #GtkAllocation * - * Returns the widget's allocation as provided by its parent. - * - * Return value: current allocation of @widget. + * Fills @allocation with the widget's allocation as provided by its parent. * * Since: GSEAL-branch */ -GtkAllocation -gtk_widget_get_allocation (GtkWidget *widget) +void +gtk_widget_get_allocation (GtkWidget *widget, + GtkAllocation *allocation) { - g_return_val_if_fail (GTK_IS_WIDGET (widget), NULL); + g_return_if_fail (GTK_IS_WIDGET (widget)); + g_return_if_fail (allocation != NULL); - return widget->allocation; + allocation->x = widget->allocation.x; + allocation->y = widget->allocation.y; + allocation->width = widget->allocation.width; + allocation->height = widget->allocation.height; } /** diff --git a/gtk/gtkwidget.h b/gtk/gtkwidget.h index 596b8eeac4..cbf070e034 100644 --- a/gtk/gtkwidget.h +++ b/gtk/gtkwidget.h @@ -572,7 +572,8 @@ void gtk_widget_set_parent_window (GtkWidget *widget, void gtk_widget_set_child_visible (GtkWidget *widget, gboolean is_visible); gboolean gtk_widget_get_child_visible (GtkWidget *widget); -GtkAllocation gtk_widget_get_allocation (GtkWidget *widget); +void gtk_widget_get_allocation (GtkWidget *widget, + GtkAllocation*allocation); GdkWindow* gtk_widget_get_window (GtkWidget *widget); GtkWidget *gtk_widget_get_parent (GtkWidget *widget);